package com.business.bean.oa;

import java.util.Date;

import lombok.Getter;
import lombok.Setter;
import net.sf.rose.jdbc.bean.ModelBean;
import net.sf.rose.jdbc.bean.annotation.Column;
import net.sf.rose.jdbc.bean.annotation.Table;
import net.sf.rose.jdbc.bean.annotation.Type;
import net.sf.rose.jdbc.bean.annotation.View;

/**
 * 请假时选择日期，再选择全天、上午或下午，如果是全天可以选择结束日期
 * <P>
 * 如果是上午，新增一条上班时间点的考勤记录
 * <P>
 * 如果是下午，新增一条下班时间点的考勤记录
 * <P>
 * 如果是全天，新增二条上下班时间点的考勤记录
 * <P>
 * 如果是多天，每天2条生成多条考勤记录
 */
@Setter
@Getter
@Table(name = "OA_WORK_APPLYTIME", description = "请假表")
@View(name = "OA_WORK_APPLYTIME_VIEW", description = "请假视图")
public class WorkApplyTime extends ModelBean {

	@Column(pk = true, type = Type.定长文本, description = "请假编号", canNull = false, size = 32, policy = "UUID")
	private String applyTimeID = null;

	@Column(type = Type.定长文本, description = "用户编号", size = 32)
	private String userID = null;

	@Column(type = Type.变长文本, description = "工号", size = 10)
	private transient String workNo = null;

	@Column(type = Type.变长文本, description = "用户姓名", size = 50)
	private transient String userName = null;

	@Column(type = Type.定长文本, description = "部门编号", size = 32)
	private transient String departID = null;

	@Column(type = Type.变长文本, description = "部门名称", size = 100)
	private transient String departName = null;

	@Column(type = Type.日期时间, description = "提交时间")
	private Date submitTime = null;

	/** 1:事假;2:病假;3:调休假;4:年休假;5:工伤假;6:体检假;7:婚假;8:产假;9:育儿假;10:护理假;11:丧假; */
	@Column(type = Type.数字整型, description = "请假类型")
	private int dataType = 0;

	public static int APPLY_TYPE_NO = 0;
	public static int APPLY_TYPE_MORNING = 1;
	public static int APPLY_TYPE_AFTERNOON = 2;
	public static int APPLY_TYPE_DAY = 3;
	public static int APPLY_TYPE_MANY_DAY = 4;

	/** 0:没有请假;1:上午请假;2:下午请假;3:全天请假;4:多天 */
	@Column(type = Type.数字整型, description = "请假类别")
	private int applyType = 0;

	@Column(type = Type.日期时间, description = "请假开始时间")
	private Date startTime = null;

	@Column(type = Type.日期时间, description = "请假结束时间")
	private Date endTime = null;

	@Column(type = Type.数字双精度型, description = "请假时长")
	private double applyTime = 0;

	@Column(type = Type.变长文本, description = "请假描述", size = 250)
	private String description = null;

	@Column(type = Type.定长文本, description = "审核人编号", size = 32)
	private String checkUserID = null;

	@Column(type = Type.变长文本, description = "审核人姓名", size = 50)
	private transient String checkUserName = null;

	@Column(type = Type.日期时间, description = "审核时间")
	private Date checkTime = null;

	/** 0：未提交；1：通过；2：不通过；6：已提交 */
	@Column(type = Type.数字整型, description = "审核状态")
	private int status;

	@Column(type = Type.变长文本, description = "审核备注", size = 250)
	private String checkRemark = null;

}
